package com.yfs.cloud.commons;

import static com.yfs.cloud.commons.Constants.*;

/**
 * @Company: 影法師工作室
 * @Description: 返回状态枚举, 子工程如果有自己的ResultCode的话, 请继承本类
 * @author 影法師
 * @date 2020年8月24日 下午4:13:16
 * @version V1.0
 */
public class ResultCode {

	public ResultCode() {
	}

	public static final ResultCode SUCCESS = new ResultCode(SUCCESS_CODE, SUCCESS_MSG);

	/** 系统异常开始 */
	public static final ResultCode SYSTEM_ERROR = new ResultCode(SYSTEM_ERROR_CODE, SYSTEM_ERROR_MSG);
	/** 系统异常结束 */

	/** 业务异常开始 */
	public static final ResultCode USER_LOGIN_FAILED = new ResultCode(USER_LOGIN_FAILED_CODE, USER_LOGIN_FAILED_MSG);

	public static final ResultCode JWT_EMPTY = new ResultCode(JWT_EMPTY_CODE, JWT_EMPTY_MSG);

	public static final ResultCode JWT_INVALID = new ResultCode(JWT_INVALID_CODE, JWT_INVALID_MSG);

	public static final ResultCode JWT_EXPIRE = new ResultCode(JWT_EXPIRE_CODE, JWT_EXPIRE_MSG);

	public static final ResultCode APIIDEMPOTENT_REPEAT_COMMIT = new ResultCode(APIIDEMPOTENT_REPEAT_COMMIT_CODE,
			APIIDEMPOTENT_REPEAT_COMMIT_MSG);

	public static final ResultCode APIIDEMPOTENT_TOKEN_EMPTY = new ResultCode(APIIDEMPOTENT_TOKEN_EMPTY_CODE,
			APIIDEMPOTENT_TOKEN_EMPTY_MSG);

	public static final ResultCode ACCESS_DENY = new ResultCode(ACCESS_DENY_CODE, ACCESS_DENY_MSG);

	public static final ResultCode AUTHCHECKER_NOT_REGULAR = new ResultCode(AUTHCHECKER_NOT_REGULAR_CODE,
			AUTHCHECKER_NOT_REGULAR_MSG);

	public static final ResultCode SMS_SEND_FAILED = new ResultCode(SMS_SEND_FAILED_CODE, SMS_SEND_FAILED_MSG);

	public static final ResultCode PHONE_ERROR = new ResultCode(PHONE_ERROR_CODE, PHONE_ERROR_MSG);

	public static final ResultCode XSS_ATTACK = new ResultCode(XSS_ATTACK_CODE, XSS_ATTACK_MSG);
	/** 业务异常结束 */

	/** 校验异常开始 */

	public static final ResultCode PARAM_IS_INVALID = new ResultCode(PARAM_IS_INVALID_CODE, PARAM_IS_INVALID_MSG);

	/** 校验异常结束 */

	/** Assert 异常开始 */
	public static final ResultCode ASSERT_FAILED = new ResultCode(ASSERT_FAILED_CODE, "");
	/** Assert 异常结束 */

	private Integer code;
	private String msg;

	private ResultCode(Integer code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public Integer getCode() {
		return this.code;
	}

	public String getMsg() {
		return this.msg;
	}
}
